﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ToolPositioningInternal.CApTPILabelParams
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.ComponentModel;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.ToolPositioningInternal;

public class CApTPILabelParams : INotifyPropertyChanged
{
  private string _label;
  private int _images = 3000;
  private string _background = "#FFFFFF";
  private string _size = "340x340";

  public ITxObject Object { get; set; }

  public string Label
  {
    get => this._label;
    set
    {
      this._label = value;
      this.NotifyPropertyChanged(nameof (Label));
    }
  }

  public int NumberOfImages
  {
    get => this._images;
    set
    {
      this._images = value;
      this.NotifyPropertyChanged(nameof (NumberOfImages));
    }
  }

  public string Background
  {
    get => this._background;
    set
    {
      this._background = value;
      this.NotifyPropertyChanged(nameof (Background));
    }
  }

  public string Size
  {
    get => this._size;
    set
    {
      this._size = value;
      this.NotifyPropertyChanged(nameof (Size));
    }
  }

  public int Width
  {
    get
    {
      int result;
      int.TryParse(this.Size.Split('x')[0], out result);
      return result;
    }
  }

  public int Height
  {
    get
    {
      int result;
      int.TryParse(this.Size.Split('x')[1], out result);
      return result;
    }
  }

  public event PropertyChangedEventHandler PropertyChanged;

  private void NotifyPropertyChanged(string propertyName = "")
  {
    PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
    if (propertyChanged == null)
      return;
    propertyChanged((object) this, new PropertyChangedEventArgs(propertyName));
  }
}
